import request from '@/utils/request'

// 获取-分页查询角色列表
export const getRoles = (params) => request.get('/sys/role', { params })

// 新增-角色
export const addRoles = (data) => request.post('/sys/role', data)

// 修改-角色
export const updataRoles = (data) => request.put(`/sys/role/${data.id}`, data)

/**
 * 删除-角色
 * @param {numder} id
 */
export const delRole = id => request.delete(`/sys/role/${id}`)

// 获取-已启用的角色列表
export const getRoleList = () => request.get('/sys/role/list/enabled')

// 获取-角色详情
export const getRoleDetails = (id) => request.get(`/sys/role/${id}`)

// 分配-员工-角色
export const assignRoles = (data) => request.put('/sys/user/assignRoles', data)
